package com.koala.learn.date_chapter;

import org.junit.Test;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;

/**
 * 时间注解处理
 *
 * @author yantingrui
 * @date 2022/3/29   14:42
 */
public class Start {
    public static void main(String[] args) {
        //ObjectMapper mapper = new ObjectMapper();
        LocalDate local = LocalDate.now();
        if (local instanceof LocalDate) {

        }
        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MttM-dd");
        String format = local.format(dateTimeFormatter);
        System.out.println(format);
    }

    /**
     *
     */
    @Test
    public void test29() {
        LocalDate date = LocalDate.parse("20140305", DateTimeFormatter.BASIC_ISO_DATE);
        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("dd/MM/yyyy");
        String format = date.format(dateTimeFormatter);
        System.out.println(format);
        LocalDate parse = LocalDate.parse(format, dateTimeFormatter);
        System.out.println(parse);
    }
}
